package com.qf.qfdrivermqtt.api;

import com.qf.common.bean.R;
import com.qf.common.dto.CmdParamDto;
import com.qf.common.feigns.MqttApi;
import com.qf.qfdrivermqtt.service.CmdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MqttFeignApi implements MqttApi {

    @Autowired
    private CmdService cmdService;

    @PostMapping("/api/mqtt/send")
    public R send(@RequestBody(required = false) CmdParamDto cmdParamDto) {
        System.out.println("=====================");
        return cmdService.send(cmdParamDto);
    }
}
